//
//  DetailViewController.m
//  Rockval
//
//  Created by TuanNT on 4/29/14.
//  Copyright (c) 2014 TNL. All rights reserved.
//

#import "DetailViewController.h"
#import "DataModels.h"

@interface DetailViewController ()
@property (weak, nonatomic) IBOutlet UILabel *lblName;
@property (weak, nonatomic) IBOutlet UILabel *lblAddress;
@property (weak, nonatomic) IBOutlet UIImageView *imgThumbnail;
@property (weak, nonatomic) IBOutlet UILabel *lblPrice;
@property (weak, nonatomic) IBOutlet UILabel *lblSize;
@property (weak, nonatomic) IBOutlet UILabel *lblPricePerSize;
@property (weak, nonatomic) IBOutlet UILabel *lblType;
@property (weak, nonatomic) IBOutlet UILabel *lblSubType;
@end

@implementation DetailViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
	self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
	if (self) {
		// Custom initialization
	}
	return self;
}

- (void)viewDidLoad {
	[super viewDidLoad];
	// Do any additional setup after loading the view.
	[self fillDataToView];
}

- (void)viewWillAppear:(BOOL)animated {
	[super viewWillAppear:animated];
}

- (void)didReceiveMemoryWarning {
	[super didReceiveMemoryWarning];
	// Dispose of any resources that can be recreated.
}

/*
   #pragma mark - Navigation

   // In a storyboard-based application, you will often want to do a little preparation before navigation
   - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
   {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
   }
 */

//================================ SETTER ================================
#pragma mark -
#pragma mark SETTER

//================================ METHODS ================================
#pragma mark -
#pragma mark METHODS

- (void)fillDataToView {
	self.lblName.text         = _building.name;
	self.lblAddress.text      = _building.address;
	self.lblPrice.text        = _building.price;
	self.lblSize.text         = _building.size;
	self.lblPricePerSize.text = _building.val;
	self.lblType.text         = _building.main;
	self.lblSubType.text      = _building.sub;
	[self.imgThumbnail setImageWithURL:[NSURL URLWithString:[_building.image stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
}

@end
